<?php $this->load->module('mobile/index/header', $common);?>
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/main.css" />
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/dialog.css" />
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/base.css" />
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/index.css" />
<link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/template/default/mobile/css/line.css" />

<script type="text/javascript" src="<?php echo URLPRE;?>static/template/default/mobile/js/mobilecommon.js"></script>
<script type="text/javascript" src="<?php echo URLPRE;?>static/template/default/mobile/js/slider.js"></script>
<script type="text/javascript" src="<?php echo URLPRE;?>static/template/default/mobile/js/dialog.js"></script>
<style>
.f14{font-size:14px}
</style>
<div class="content">
    <div class="order-head-memu-box">
        <ul class="order-head-memu-list">
            <li class="head-menu-item head-menu-item-on"><a href="<?php echo site_url('mobile/order/line_list');?>">线路</a></li>
            <li class="head-menu-item"><a href="<?php echo site_url('mobile/order/ticket_list');?>">门票</a></li>
            <li class="head-menu-item"><a href="<?php echo site_url('mobile/order/flight_list');?>">机票</a></li>
            <li class="head-menu-item"><a href="<?php echo site_url('mobile/order/rent_list');?>">租车</a></li>
         </ul>
    </div>
    <div id="list">
         <?php if(!$datalist):?>
             <a>
                <div class="list-item fn-clear">
                    <div class="info">
                        <h5>暂无订单</h5>
                        <div class="i-note"></div>
                    </div>
                </div>
            </a>
         <?php else:?>
        <?php foreach ($datalist as $v): ?>
            <a href="<?php echo $v['link'];?>">
                <div class="list-item fn-clear">
                    <div class="info">
                        <h5><?php echo $v['line_name'];?></h5>
                        <div class="i-note">
                            <p class="price">
                                <?php if (!empty($v['order_account'])) :?>
                                    ¥<?php echo $v['order_account'];?>
                                <?php endif; ?>
                            </p>
                            <p class="f14">订单编号：<?php echo $v['order_sn'];?></p>
                            <p class="f14">订单状态：<?php echo $v['order_status_name'],' / ',$v['pay_status_name'];?></p>
                            <p class="f14">出行时间：<?php echo $v['go_date'];?></p>
                            <p class="f14">下单时间：<?php echo $v['add_time'];?></p>
                            <?php if(ADMINID){ ?>
                                <p class="f14">订单佣金：¥ <?php echo $v['back_account'];?></p>
                                <p class="f14">返佣状态：<?php echo $v['back_status'] ? '已返' : '待返';?></p>
                            <?php }?>
                        </div>
                    </div>
                    <span class="arrow-right"></span>
                </div>
            </a>
        <?php endforeach ;?>
              <a href="javascript:;" class="btn-grey btn">加载更多</a>
         <?php endif;?>
    </div>

</div>
<?php $this->load->module('mobile/index/footer', $common);?>
<script type="text/javascript">
    $(function(){
        var slid = $("#sliderimg").slider({
            loop: true
        });
        var page = <?php echo $page+1;?>;

        var url = '<?php echo site_url('mobile/order/line_list');?>';
        $('.btn-grey').click(function(){
            var $this = $(this);
            $this.text('加载中...');
            $.get(url+(url.indexOf('?')!=-1 ?'&':'/?')+'isajax=1&page='+page, function(data){

                if(data.length>0){
                    var html = '';
                    for(var i =0; i<data.length; i++){
                        var item = data[i];
                        html += '<a href="">' +
                            '<div class="list-item fn-clear"><div class="info">' +
                            '<h5>'+ item.line_name +'</h5>' +
                            '<div class="i-note"><p><span class="price">'+item.order_account+'</span></p>' +
                            '<p><span>订单编号：'+ item.order_sn +'</span></p>' +
                            '<p><span>订单状态：'+ item.order_status_name +'</span></p>' +
                            '<p><span>出行时间：'+ item.go_date +'</span></p>' +
                            '<p><span>下单时间：'+ item.add_time +'</span></p>' +
                            '</div></div><span class="arrow-right"></span></div></a>';
                    }
                    $('#list').append(html);
                    page ++;
                    $this.text('加载更多');
                }else{

                    $.dialog({
                        style:'tip',
                        width:200,
                        closeTime:1000,
                        content: '<p style="text-align: center">没有更多了</p>'
                    }).open();
                    $this.text('没有更多了');
                }

            },'json');
        });

    });
</script>